<template>
  <van-nav-bar title="绑定设备" left-text="返回" left-arrow @click-left="onClickLeft" />
  <div class="container">
    <header></header>
    <main>
      <div class="device-image">
        <img src="../../img/1f.png" alt="设备图标" />
      </div>
      <div class="prompt">快来绑定你的第一台设备<br />开启你的健康管理~</div>
    </main>
    <footer>
      <div class="recommended-devices">
        <h4 style="float: left">热门设备推荐</h4>
        <br />
        <br />
        <div class="device-list">
          <div class="device">
            <img src="../../img/pressa.jpg" alt="欧姆龙电子血压计U32K" />
            <p>欧姆龙电子血压计U32K</p>
          </div>
          <div class="device">
            <img src="../../img/watcha.jpg" alt="华为手环6" />
            <p>华为手环6</p>
          </div>
          <div class="device">
            <img src="../../img/wachb.jpg" alt="Apple Watch" />
            <p>Apple Watch</p>
          </div>
          <div class="device">
            <img src="../../img/bicya.jpg" alt="健利达动感单车Deepsleep S8 Pro" />
            <p>健利达动感单车Deepsleep S8 Pro</p>
          </div>
        </div>
      </div>
      <div class="bind-button">
        <button @click="bind()">绑定设备</button>
      </div>
    </footer>
  </div>
</template>
<script setup lang="ts">
import { useRouter } from 'vue-router'
const router = useRouter()
// 返回
const onClickLeft = () => {
  router.go(-1)
}
// 绑定设备跳转页面
const bind = () => {
  router.push('/bindind')
}
</script>
<style>
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f0f2f5;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.container {
  width: 100%;
  margin: 0 auto;
  height: 100%;
}

.device-image {
  text-align: center;
  margin-bottom: 10px;
}

.prompt {
  text-align: center;
  margin-bottom: 10px;
}

.recommended-devices {
  text-align: center;
  margin-bottom: 10px;
  position: absolute;
  bottom: 50px;
  left: 0px;
  width: 100%;
  background: #fff;
  height: 160px;
}

.device-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.device {
  width: 25%;
  margin: 0 auto;
  margin-bottom: 10px;
  text-align: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.device img {
  width: 50%;
  height: 50%;
}

.bind-button {
  text-align: center;
}

button {
  text-align: center;
  position: absolute;
  bottom: 0px;
  left: 0px;
  width: 100%;
  background-color: green;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
}
img {
  width: 300px;
  height: 300px;
}
</style>
